home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Night Owl 8
/
Night Owl CD-ROM (NOPV8) (Night Owl Publisher) (1993).ISO
/
047a
/
lex_yacc.arj
/
STRIP.L
< prev
next >
Wrap
Text File
|
1989-05-28
|
461b
|
19 lines
{ A sample Lex program that strips whitespace from stdin and writes result
to stdout; when running the program you can use DOS I/O redirection, e.g.
strip <input-file >output-file }
uses LexLib;
%%
^[ \t]*\n ; { ignore empty lines }
[ \t]+$ ; { ignore trailing whitespace }
[ \t]+ write(yyout, ' ');
{ replace remaining whitespace by single blank }
%%
begin
if yylex=0 then { done }
end.